#ifndef __EKOS_KERNEL_IOAPIC_H__
#define __EKOS_KERNEL_IOAPIC_H__

struct ioapic_t
{
	 int id;
	 physaddr_t phys;
	 uint32_t intr_base;
};

// IO APIC MMIO structure: write reg, then read or write data.
struct ioapic
{
	 uint32_t reg;
	 uint32_t pad[3];
	 uint32_t data;
};
typedef volatile struct ioapic ioapic_mmio_t;
extern struct ioapic_t ioapics[IOAPIC_MAX_COUNT];

void ioapic_init(void);
void ioapic_enable(ioapic_mmio_t *ioapic, int irq, int cpunum);

#endif
